﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

namespace Nirvana
{
    [AddComponentMenu("Nirvana/UI/Bind/Variable Bind Interactable")]
    [RequireComponent(typeof(Selectable))]
    public sealed class UIVariableBindInteractable : UIVariableBindBool
    {
        private Selectable _selectable;
        protected override void OnValueChanged()
        {
            if (this._selectable == null)
            {
                this._selectable = base.GetComponent<Selectable>();
            }
            this._selectable.interactable = base.GetResult();
        }
    }
}

